#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=310,Q=100001;
const ll inf=1e16;
int n,m,q,s,t;
ll f[N][N];
struct edge{
    int to,nxt,flow;
    ll cost;
}g[N*N*2+N*4];
int cnt=1,head[N*2];
void add(int u,int v,int f,int c){
    g[++cnt]=(edge){v,head[u],f,c};
    head[u]=cnt;
    g[++cnt]=(edge){u,head[v],0,-c};
    head[v]=cnt;
}
struct node{
    int c,d;
}a[Q];
bool cmp(node i,node j){
    return i.c<j.c;
}
ll dis[N*2];
bool vis[N*2];
int fa[N*2],id[N*2];
void spfa(){
    for(int i=1;i<=t;i++)dis[i]=inf;
    dis[s]=0;
    queue<int> q;
    q.push(s);
    while(!q.empty()){
        int u=q.front();
        q.pop();
        vis[u]=0;
        for(int i=head[u];i;i=g[i].nxt){
            int v=g[i].to,f=g[i].flow;
            ll c=g[i].cost;
            if(f&&dis[u]+c<dis[v]){
                dis[v]=dis[u]+c;
                fa[v]=u;
                id[v]=i;
                if(!vis[v]){
                    q.push(v);
                    vis[v]=1;
                }
            }
        }
    }
}
ll ans[Q];
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    freopen("journey.in","r",stdin);
    freopen("journey.out","w",stdout);
    cin>>n>>m>>q;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            f[i][j]=inf;
    for(int i=1;i<=m;i++){
        int u,v,w;
        cin>>u>>v>>w;
        f[u][v]=min(f[u][v],(ll)w);
    }
    for(int k=1;k<=n;k++)
        for(int i=1;i<=n;i++)
            for(int j=1;j<=n;j++)
                f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
    s=2*n+1,t=2*n+2;
    for(int i=1;i<=n;i++)add(s,i,1,0),add(i+n,t,1,0);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            if(f[i][j]<inf)add(i,j+n,1,f[i][j]);
    for(int i=1;i<=q;i++){
        cin>>a[i].c;
        a[i].d=i;
    }
    sort(a+1,a+q+1,cmp);
    spfa();
    int F=0;
    ll C=0;
    for(int i=1;i<=q;i++){
        while(dis[t]<a[i].c){
            F++;
            C+=dis[t];
            int u=t;
            while(u!=s){
                g[id[u]].flow--;
                g[id[u]^1].flow++;
                u=fa[u];
            }
            spfa();
        }
        ans[a[i].d]=1ll*(n-F)*a[i].c+C;
    }
    for(int i=1;i<=q;i++)cout<<ans[i]<<'\n';
    return 0;
}
